/*
 * Created by JFormDesigner on Sun Jul 03 02:13:29 EDT 2011
 */

package ca.etsmtl.log730.lab3.view;

import java.awt.*;
import javax.swing.*;
import ca.etsmtl.log730.lab3.controllers.*;
import org.jdesktop.beansbinding.*;
import org.jdesktop.beansbinding.AutoBinding.UpdateStrategy;
import org.jdesktop.swingbinding.*;

/**
 * @author Joe Labrosse
 */
public class BranchSuccursale extends JFrame {
	public BranchSuccursale() {
		initComponents();
	}

	public BranchController getBranchController() {
		return branchController;
	}

	private void initComponents() {
		// JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
		// Generated using JFormDesigner Evaluation license - Joe Labrosse
		button2 = new JButton();
		scrollPane1 = new JScrollPane();
		textArea1 = new JTextArea();
		label1 = new JLabel();
		textField1 = new JTextField();
		label2 = new JLabel();
		comboBox1 = new JComboBox();
		button3 = new JButton();
		label3 = new JLabel();
		textField2 = new JTextField();
		branchController = new BranchController();

		//======== this ========
		setResizable(false);
		Container contentPane = getContentPane();

		//---- button2 ----
		button2.setText("Capture Snapshot");

		//======== scrollPane1 ========
		{
			scrollPane1.setViewportView(textArea1);
		}

		//---- label1 ----
		label1.setText("Montant \u00e0 transf\u00e9rer");

		//---- label2 ----
		label2.setText("Vers Succursale");

		//---- button3 ----
		button3.setText("Transf\u00e9rer");

		//---- label3 ----
		label3.setText("Somme Disponible");

		//---- textField2 ----
		textField2.setEditable(false);

		GroupLayout contentPaneLayout = new GroupLayout(contentPane);
		contentPane.setLayout(contentPaneLayout);
		contentPaneLayout.setHorizontalGroup(
			contentPaneLayout.createParallelGroup()
				.addGroup(contentPaneLayout.createSequentialGroup()
					.addContainerGap()
					.addGroup(contentPaneLayout.createParallelGroup()
						.addComponent(scrollPane1, GroupLayout.DEFAULT_SIZE, 544, Short.MAX_VALUE)
						.addGroup(contentPaneLayout.createSequentialGroup()
							.addGroup(contentPaneLayout.createParallelGroup()
								.addGroup(contentPaneLayout.createSequentialGroup()
									.addComponent(label3, GroupLayout.PREFERRED_SIZE, 95, GroupLayout.PREFERRED_SIZE)
									.addGap(20, 20, 20)
									.addComponent(textField2, GroupLayout.PREFERRED_SIZE, 150, GroupLayout.PREFERRED_SIZE))
								.addGroup(contentPaneLayout.createSequentialGroup()
									.addGap(115, 115, 115)
									.addComponent(textField1, GroupLayout.PREFERRED_SIZE, 150, GroupLayout.PREFERRED_SIZE))
								.addComponent(label1)
								.addGroup(contentPaneLayout.createSequentialGroup()
									.addComponent(label2)
									.addGap(14, 14, 14)
									.addComponent(comboBox1, GroupLayout.PREFERRED_SIZE, 150, GroupLayout.PREFERRED_SIZE)))
							.addGap(10, 10, 10)
							.addComponent(button3, GroupLayout.PREFERRED_SIZE, 130, GroupLayout.PREFERRED_SIZE)
							.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 9, Short.MAX_VALUE)
							.addComponent(button2, GroupLayout.PREFERRED_SIZE, 130, GroupLayout.PREFERRED_SIZE)))
					.addContainerGap())
		);
		contentPaneLayout.setVerticalGroup(
			contentPaneLayout.createParallelGroup()
				.addGroup(contentPaneLayout.createSequentialGroup()
					.addContainerGap()
					.addGroup(contentPaneLayout.createParallelGroup()
						.addGroup(contentPaneLayout.createSequentialGroup()
							.addGroup(contentPaneLayout.createParallelGroup()
								.addComponent(label3)
								.addComponent(textField2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
							.addGap(3, 3, 3)
							.addGroup(contentPaneLayout.createParallelGroup()
								.addComponent(textField1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
								.addGroup(contentPaneLayout.createSequentialGroup()
									.addGap(5, 5, 5)
									.addComponent(label1)))
							.addGap(3, 3, 3)
							.addGroup(contentPaneLayout.createParallelGroup()
								.addGroup(contentPaneLayout.createSequentialGroup()
									.addGap(5, 5, 5)
									.addComponent(label2))
								.addComponent(comboBox1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
						.addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
							.addComponent(button3, GroupLayout.PREFERRED_SIZE, 70, GroupLayout.PREFERRED_SIZE)
							.addComponent(button2, GroupLayout.PREFERRED_SIZE, 70, GroupLayout.PREFERRED_SIZE)))
					.addGap(13, 13, 13)
					.addComponent(scrollPane1, GroupLayout.DEFAULT_SIZE, 250, Short.MAX_VALUE)
					.addContainerGap())
		);
		pack();
		setLocationRelativeTo(getOwner());

		//---- bindings ----
		bindingGroup = new BindingGroup();
		bindingGroup.addBinding(Bindings.createAutoBinding(UpdateStrategy.READ_WRITE,
			branchController, BeanProperty.create("branch.amount"),
			textField2, BeanProperty.create("text")));
		bindingGroup.addBinding(SwingBindings.createJComboBoxBinding(UpdateStrategy.READ_WRITE,
			branchController, (BeanProperty) BeanProperty.create("branchList"), comboBox1));
		bindingGroup.addBinding(Bindings.createAutoBinding(UpdateStrategy.READ_WRITE,
			branchController, BeanProperty.create("branch.name"),
			this, BeanProperty.create("title")));
		bindingGroup.bind();
		// JFormDesigner - End of component initialization  //GEN-END:initComponents
	}

	// JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables
	// Generated using JFormDesigner Evaluation license - Joe Labrosse
	private JButton button2;
	private JScrollPane scrollPane1;
	private JTextArea textArea1;
	private JLabel label1;
	private JTextField textField1;
	private JLabel label2;
	private JComboBox comboBox1;
	private JButton button3;
	private JLabel label3;
	private JTextField textField2;
	private BranchController branchController;
	private BindingGroup bindingGroup;
	// JFormDesigner - End of variables declaration  //GEN-END:variables
}
